package cn.tonyandmoney.voicenotes.notes.filters;

import android.util.Log;

import cn.tonyandmoney.baidu.asr.entity.NluResult;
import cn.tonyandmoney.voicenotes.notes.enums.OperationEnum;
import cn.tonyandmoney.voicenotes.notes.presenter.IOperation;

public class IntentFilter extends BaseFilter {

    public IntentFilter(IOperation iOperation) {
        super(iOperation);
    }

    @Override
    protected String getDomain() {
        return "intent";
    }

    @Override
    protected void operation(NluResult result) {
        switch (result.getIntent()) {
            case "memo":
                iOperation.operation(OperationEnum.INTENT_NEW_MEMO);
                break;
            case "file":
                iOperation.operation(OperationEnum.INTENT_OPEN_FILE);
                break;
            case "note":
                iOperation.operation(OperationEnum.INTENT_OPEN_NOTE);
                break;
            case "alarm":
                iOperation.operation(OperationEnum.INTENT_OPEN_ALARM);
                break;
            case "setting":
                iOperation.operation(OperationEnum.INTENT_OPEN_SETTING);
                break;
            default:
                Log.i("IntentFilter", "未实现的意图。");
                break;
        }
    }
}
